﻿abc 
123 thay doi
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Demo_03_05_2011
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            //this.BackColor = Color.Red;
            //Image image = Image.FromFile(@"d:\articleItemBackground_Selected.png");
            //this.BackgroundImage = image;
            this.Text = "My Application";
            //this.TransparencyKey = this.panel1.BackColor;
            //this.WindowState = FormWindowState.Maximized;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form2 frm = new Form2();
            DialogResult res = frm.ShowDialog();
            if (res == DialogResult.OK)
            {
                MessageBox.Show("ban vua dong form bang button OK");
            }
            else
            {
                if (res == DialogResult.Cancel)
                {
                    MessageBox.Show("ban vua dong form bang button Cancel");
                }
            }

            //this.label1.Text = "Toi di hoc. Em di choi.";
            //this.textBox2.Text = "Toi dhi c";
            this.textBox1.Copy();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.button1.Text = "OK";
            this.textBox2.CharacterCasing = CharacterCasing.Upper;
            
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            //if (MessageBox.Show("Chac hong?", "Thong bao", MessageBoxButtons.YesNo) == DialogResult.No)
            //{
            //    //huy
            //    e.Cancel = true;
            //}
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            e.Graphics.DrawLine(new Pen(Color.Red, 5), 10, 100, 500, 200);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //this.textBox2.Paste();
            foreach (string s in this.textBox1.Lines)
            {
                MessageBox.Show(s);
            }
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            this.label2.Text = textBox2.Text;

        }
    }
}
